<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>CCD数据字典</title>
    <style media="screen">
        html {
            color: #000;
            background: #ECEADF
        }

        body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, form, input, textarea, p, blockquote, th, td {
            margin: 0;
            padding: 0;
            font-size: 14px;
            font-family: Arial, sans-serif
        }

        table {
            border-collapse: collapse;
            border-spacing: 0;
            table-layout: fixed;
        }

        a {
            color: #00e;
        }

        h2 {
            padding-left: 10px;
        }

        h2 a {
            text-decoration: none;
        }

        .btn {
            display: block;
            padding-left: 30px;
            height: 40px;
            line-height: 26px;
            text-decoration: none;
            font-weight: bold;
            border-radius: 5px;
        }

        .CCD_datagrid {
            border: none;
            border-left: 1px #aaa solid;
            border-top: 1px #aaa solid;
            width: 98%;
        }

        .CCD_datagrid thead {
            background: #e0e0d0;
        }

        .CCD_datagrid tr {
            height: 25px;
        }

        .CCD_datagrid tr:nth-child(2n) {
            background: #e0e0d0;
        }

        .CCD_datagrid tr:hover td {
            background: #654b24;
            color: #fff;
        }

        .CCD_datagrid tr.selected td {
            background: #b83400;
            color: #fff;
        }

        .CCD_datagrid tr:hover a, .CCD_datagrid tr:hover span, .CCD_datagrid tr.selected a, .CCD_datagrid tr.selected span {
            color: #fff;
        }

        .CCD_datagrid tr th, .CCD_datagrid tr td {
            border-width: 0 1px 1px 0;
            border-style: solid;
            border-color: #aaa;
            padding: 0 4px;
            overflow: hidden;
        }
    </style>
</head>
<body>
<div style="width:240px;position: absolute;left: 0;top:0;bottom: 0;overflow: scroll;padding: 20px 0 500px 0;">
    <h2><a href="#TABLE">数据表</a></h2>
    <foreach name="tablesData" item="value">
        <if condition="$value.table_view == 0">
        <a href="#{$value.table}" class="btn">{$value.table}({$value.table_name})</a>
            <else/>
            <a href="#{$value.table}" class="btn" style="color: red">{$value.table}({$value.table_name})</a>
        </if>
        <hr/>
    </foreach>
</div>

<div style="width:auto;position: absolute;left: 240px;right:0;top:0;bottom: 0;overflow: scroll;padding:20px 0 600px 20px;">
    <h2 id="TABLE">数据表</h2>
    <foreach name="tablesData" item="value">
        <table class='CCD_datagrid' id="{$value.table}">
            <tr style="visibility: hidden">
                <th colspan="7"></th>
            </tr>
            <tr>
                <th colspan="7">
                    数据表名称：{$value.table}
                </th>
            </tr>
            <tr>
                <th colspan="7" style='text-align: left;'>
                    备注：{$value.table_name}
                    <form action="{:U('System/UpdateTableName')}" method="post">
                        <input type="hidden" name="TABLE" value="{$value.table}">
                        <input name="TABLE_NAME" value="{$value.table_name}">
                        <input type="submit" value="修改">
                    </form>
                </th>
            </tr>
        </table>
        <table class='CCD_datagrid'>
            <thead>
            <tr>
                <th style="width:160px;">字段名</th>
                <th style="width:150px;">字段类型</th>
                <th style="width:30px;">允许为空</th>
                <th style="width:30px;">索引类型</th>
                <th style="width:160px;">默认值</th>
                <th style="width:160px;">附加属性</th>
                <th style="width:auto">备注</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="value.info" item="v">
                <tr>
                    <td>{$v.Field}</td>
                    <td>{$v.Type}</td>
                    <td>{$v.Null}</td>
                    <td>{$v.Key}</td>
                    <td>{$v.Default}</td>
                    <td>{$v.Extra}</td>
                    <td>{$v.Comment}</td>
                </tr>
            </foreach>
            </tbody>
        </table>
    </foreach>
</div>
</body>
</html>